<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{if $askcount!='0'}<?php $name=obj('index/global','controller')->type('y',$askinfo['pid'],'plug_gift_wendatype'); echo $name['name'];?>_{/if}{obj('base/Base')->SET('giftseo','q_title')}</title>
<meta name="keywords" content="{obj('base/Base')->SET('giftseo','q_keywords')}" />
<meta name="description" content="{obj('base/Base')->SET('giftseo','q_dec')}" />
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<link rel="stylesheet" href="{__PUBLIC__}h5/wui/style/weui.css"/>
<link rel="stylesheet" href="{__PUBLIC__}h5/wui/style/weui2.css"/>
<link rel="stylesheet" href="{__PUBLIC__}h5/wui/style/weui3.css"/>
<link rel="stylesheet" href="{__PUBLIC__}h5/swiper/dist/css/swiper.min.css">
<link href="{__PUBLIC__}h5/css/index.css?v=<?=time()?>" rel="stylesheet" type="text/css">
<script src="{__PUBLIC__}h5/wui/zepto.min.js"></script>
<link rel="stylesheet" href="{__PUBLIC__}h5//more/dist/dropload.css?time=<?=time()?>"/>
</head>
<style>
body{background:#f8f8f8}
</style>
<body>


<div class="weui_btn_warn weui-header " style="background:#f84e4e"> 
  <div class="weui-header-left" onClick="javascript :history.back(-1);"> <a class="icon icon-109 f-white dhicon"></a>  </div>
   <h1 class="weui-header-title">{if $askcount!='0'}<?php $name=obj('index/global','controller')->type('y',$askinfo['pid'],'plug_gift_wendatype'); echo $name['name'];?>{/if}礼物问答</h1>
     <div class="weui-header-right"><a class="icon icon-3 f-white dhicon" onClick="toshare()"></a></div> 
    </div>

<div class="asklist-t">
<span class="leftasktitle">{if $askcount!='0'}<?php $name=obj('index/global','controller')->type('y',$askinfo['pid'],'plug_gift_wendatype'); echo $name['name'];?>{/if}</span>
{if $askcount!='0'}<span class="rightasknum"><strong>{$askcount}</strong>个问答</span>{/if}
</div>

<div class="asklistlibox content">
 <div class="lists"></div>


</div>
        
        
  <div style="width:100%; height:100px;"></div>
  
  {include file="app/plug/view/mgift/footer"}
{include file="app/plug/view/mgift/share"}


   <script src="{__PUBLIC__}h5/more/dist/dropload.min.js"></script>
  
  <script>
  $(function(){
    // 页数
    var page = 0;
    // 每页展示5个
    var size = 5;
   
			
    // dropload
    $('.content').dropload({
        scrollArea : window,
        loadDownFn : function(me){
            page++;
            // 拼接HTML
            var result = '';
            $.ajax({
                type: 'GET',
                url: '{url($route='plug/mgift/asklist/id=<id>', $params=array('id'=>$_GET['id']))}?t=json&page='+page,
				//url: 'http://ons.me/tools/dropload/json.php?page='+page+'&size='+size,
                dataType: 'json',
                success: function(data){
					
					 console.log(data);
                    var arrLen = data.length;
					
                    if(arrLen > 0){
	
                        for(var i=0; i<arrLen; i++){
                           result+=' <li>'
                            +'<span class="asklistboxname"><a href="'+data[i].url+'">'+data[i].title+'</a></span>'
                            +'<span class="zans"><i class="icon icon-65"></i>'+data[i].like+'</span>'
                            +'</li>';

                        }
						
				
						
						
                    // 如果没有数据
                    }else{
                        // 锁定
                        me.lock();
                        // 无数据
                        me.noData();
                    }
                    // 为了测试，延迟1秒加载
                    setTimeout(function(){
                        // 插入数据到页面，放到最后面
						//$(".weui_panel:after").css("border-top","1px solid #e5e5e5");
						$("#shoplistbox").css("background","#ffffff");
                        $('.lists').append(result);
                        // 每次数据插入，必须重置
                        me.resetload();
                    },1000);
                },
                error: function(xhr, type){
                   // alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        }
    });
});

</script>
 
</body>
</html>
